<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>个人主页</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
  <link rel="stylesheet" href="/layuiadmin/style/template.css" media="all">
</head>
<body>
<div class="layui-fluid layadmin-homepage-fluid">
  <div class="layui-row layui-col-space8">
    <div class="layui-col-md2">
      <div class="layadmin-homepage-panel layadmin-homepage-shadow">
        <div class="layui-card text-center">
          <div class="layui-card-body">
            <div class="layadmin-homepage-pad-ver">
              <img class="layadmin-homepage-pad-img" src="${requestScope.image}" width="96" height="96">
            </div>
            <h4 class="layadmin-homepage-font">${requestScope.name}</h4>
            <p class="layadmin-homepage-min-font">国际 IT 嫩🐮</p>

          </div>
        </div>
        <p class="layadmin-homepage-about">
          关于我
        </p>
        <ul class="layadmin-homepage-list-group">
          <li class="list-group-item"><i class="layui-icon layui-icon-location"></i>中国 六安 皖西学院</li>
          <div class="layadmin-homepage-pad-hor">
            <mdall>${requestScope.name}喜欢摄影，也喜欢写字，他视角独特，充满着奇思妙想。他有着极丰富的情感，和对生活的热情，他能点燃观众心中爱的火焰；胡歌积极、乐观、坚强，他脚踏实地地做好每一件事，真诚地对待身边每一个人</mdall>
          </div>
          <p class="layadmin-homepage-about">
            技能
          </p>
          <ul class="layadmin-homepage-list-inline">
            <a href="javascript:;" class="layui-btn layui-btn-primary">C#</a>
            <a href="javascript:;" class="layui-btn layui-btn-primary">JAVA</a>
            <a href="javascript:;" class="layui-btn layui-btn-primary">Python</a>
            <a href="javascript:;" class="layui-btn layui-btn-primary">SSM</a>
            <a href="javascript:;" class="layui-btn layui-btn-primary">C++</a>
          </ul>
        </ul>
      </div>

    </div>
    <div class="layui-col-md10">
      <div class="layui-fluid layadmin-homepage-content">


        <div class="layui-row layui-col-space20 layadmin-homepage-list-imgtxt">
          <div class="layui-col-md9">

            <%--发说说--%>
              <div class="grid-demo">
                <div class="panel-body layadmin-homepage-shadow">
                  <form class="layui-form" action="/shuoshuo/shuoshuo" enctype="multipart/form-data" method="post">
                    <div class="layui-form-item layui-form-text" style="margin-left: -100px;">
                      <div class="layui-input-block" style="margin-top: 20px; margin-right: 10px;">
                        <textarea name="desc"  placeholder="说点什么..." class="layui-textarea"></textarea>
                      </div>
                    </div>
                    <div class="layui-form-item" style="overflow: hidden;">
                      <div class="layui-input-block layui-input-right" style="float: right; margin-right: 20px;">
                        <button class="layui-btn" type="submit">发表</button>
                      </div>
                      <div class="layadmin-messag-icon" style="float: left; margin-left: 20px;">
                        <input type="text" name="name" value="${requestScope.id}" style="display:none;">
                        <input type="file" style="display: none" class="file" name="file" onchange="change(this)">
                        <a href="javascript:;"><i class="layui-icon layui-icon-face-smile-b"></i></a>
                        <a href="javascript:;"><i class="layui-icon layui-icon-picture" onclick="upload()"></i></a>
                      </div>
                    </div>
                    <div id="im" style="display: none">
                      <img id="image" src="" style="width: 100px">
                    </div>
                  </form>
                </div>
              </div>


            <c:forEach items="${requestScope.shuoshuo}" var="shuoshuo">
            <div class="grid-demo">
              <div class="panel-body layadmin-homepage-shadow">
                <a href="javascript:;" class="media-left">
                  <img src="${shuoshuo.image}" height="46px" width="46px">
                </a>
                <div class="media-body">
                  <div class="pad-btm">
                    <p class="fontColor"><a href="javascript:;">${shuoshuo.uname}</a></p>
                    <p class="min-font">
                      <span class="layui-breadcrumb" lay-separator="-">
                        <a href="javascript:;" class="layui-icon layui-icon-cellphone"></a>
                        <a href="javascript:;">${shuoshuo.date}</a>
                      </span>
                    </p>
                  </div>
                  <p>${shuoshuo.content}</p>
                  <%--<img class="h-img" src="/layuiadmin/style/res/template/huge.jpg">--%>
                  <div class="media">
                    <div class="media-right">
                        <%--说说--%>
                      <ul class="list-inline">
                          <li style="position: absolute;left: 50px">
                              <a class="layui-icon layui-icon-reply-fill" onclick="lypl('${shuoshuo.id}','${requestScope.id}','','')">评论</a>
                          </li>
                          <li style="position: absolute;left: 100px">
                              <c:if test="${shuoshuo.uid==requestScope.id}">
                              <a class="layui-icon layui-icon-delete" href="/del/shuoshuo/${shuoshuo.id}/${requestScope.id}">删除</a>
                              </c:if>
                          </li>
                        <li>
                          <i class="layui-icon layui-icon-praise" id="dz" onclick="dz(this,${shuoshuo.id})"></i>
                          <span>${shuoshuo.dz}</span>
                        </li>
                        <li>
                          <i class="layui-icon layui-icon-username"></i>
                          <span>${shuoshuo.look}</span>
                        </li>
                      </ul>
                    </div>
                    <div class="media-left">

                    </div>
                  </div>

                  <div class="media-list">
                          <%--评论--%>
                      <div class="layui-col-md12 ${shuoshuo.id}" style="display: none;">
                          <form class="layui-form" action="/shuoshuo/pl">
                              <input type="text" name="articleId" class="articleId" style="display: none">
                              <input type="text" name="name" class="fromName"  style="display: none">
                              <input type="text" name="toName"  class="toName"  style="display: none">
                              <div class="layui-form-item">
                                  <div class="layui-input-block">
                                      <input type="text" name="desc" id="desc" required  lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                                  </div>
                              </div>
                              <div class="layui-form-item" style="overflow: hidden;">
                                  <div class="layui-input-block layui-input-right">
                                      <button class="layui-btn" type="submit" style="float: right">发表</button>
                                  </div>
                              </div>
                          </form>
                      </div>

                   <c:forEach items="${requestScope.pl}" var="pl">
                      <c:if test="${pl.articleId == shuoshuo.id}">
                    <div class="media-item">
                      <a href="javascript:;" class="media-item-left">
                        <img class="img-xs" src="${pl.fromImage}">
                      </a>
                      <div class="media-text">
                        <div>
                          <a href="javascript:;">${pl.fromName}</a>
                          <mdall> ${pl.date}</mdall>
                        </div>
                        <div>${pl.content}</div>
                      </div>
                    <!--&ndash;删除，评论&ndash;-->
                      <div class="pad-btm">
                        <p class="min-font">
              <span class="layui-breadcrumb">
                <a class="layui-icon layui-icon-reply-fill" onclick="lypl('${shuoshuo.id}','${requestScope.id}','${pl.fromId}','@${pl.fromName}:')">评论</a>
                  <nbsp/><nbsp/><nbsp/><nbsp/><nbsp/>
                    <c:if test="${(shuoshuo.uid ==requestScope.id) || (pl.fromId == requestScope.id)}">
                      <a class="layui-icon layui-icon-delete" href="/del/pl/${pl.id}/${requestScope.id}">删除</a>
                    </c:if>
              </span>
                        </p>
                      </div>
                    </div>
                      </c:if>
                    </c:forEach>

                  </div>
                </div>
              </div>
            </div>
            </c:forEach>


          </div>
          <div class="layui-col-md3">
            <div class="grid-demo">
              <div class="layui-card homepage-top">
                <div class="layui-card-header">
                  <h3 class="panel-title">
                    <i class="layui-icon layui-icon-picture"></i>
                    画廊
                  </h3>
                </div>
                <div class="layui-card-body">
                  <div class="layui-row layui-col-space15">
                    <div class="layui-col-md4">
                      <img src="/static/image/1.jpg">
                    </div>
                    <div class="layui-col-md4">
                      <img src="/static/image/2.jpg">
                    </div>
                    <div class="layui-col-md4">
                      <img src="/static/image/3.jpg">
                    </div>
                    <div class="layui-col-md4">
                      <img src="/static/image/5.jpg">
                    </div>
                    <div class="layui-col-md4">
                      <img src="/static/image/images.jpg">
                    </div>
                    <div class="layui-col-md4">
                      <img src="/static/image/regeist.jpg">
                    </div>
                    <div class="layui-col-md4">
                      <img src="/static/image/sum.jpg">
                    </div>
                    <div class="layui-col-md4">
                      <img src="/static/image/window.jpg">
                    </div>
                    <div class="layui-col-md4">
                      <img src="/layuiadmin/style/res/template/portrait.png">
                    </div>
                    <div class="layui-col-md12 margin-top10">
                      <a href="javascript:;"  class="layui-btn layui-btn-primary">更多</a>
                    </div>
                  </div>
                </div>
              </div>
              <div class="layui-card homepage-bottom">
                <div class="layui-card-header">
                  <h3 class="panel-title">
                    <i class="layui-icon layui-icon-user"></i>
                    私信
                  </h3>
                </div>
                <div class="layui-card-body">
                    <c:forEach items="${requestScope.liuyan}" var="liuyan" >
                        <a href="javascript:;" class="layadmin-privateletterlist-item">
                            <div class="meida-left">
                                 <img src="${liuyan.fromImage}">
                            </div>
                            <div class="meida-right">
                                  <p>${liuyan.fromName}</p>
                                  <mdall>${liuyan.content}</mdall>
                             </div>
                        </a>
                    </c:forEach>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<script src="/layuiadmin/layui/layui.js"></script>
<script>
    var $;
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index'],function () {
        $ = layui.jquery;
    });
    function upload(){
        $(".file").click();
    }

    function dz(a,data) {
        if($(a).attr("style")){
            var num = $(a).next().html();
            $(a).next().html(parseInt(num)-1)
            $(a).removeAttr("style")
            $.ajax({
                type:"POST",
                url:"/shuoshuo/dz/"+data+"/-1"
            })
        }else{
            var num = $(a).next().html();
            $(a).next().html(parseInt(num)+1)
            $(a).attr("style","dispaly")
            $.ajax({
                type:"POST",
                url:"/shuoshuo/dz/"+data+"/+1"
            })
        }
    }

    function lypl(id,fName,tName,desc) {
        $("."+id).css('display','block');
        $(".articleId").val(id);
        $(".fromName").val(fName);
        $(".toName").val(tName);
        $('#desc').attr('placeholder',desc);
    }

    function change(val) {
        $('#im').css("display","block")
        $('#image').attr("src","/image/"+val.value.split("\\")[2].split("\.")[0]+"/"+val.value.split("\\")[2].split("\.")[1])
    }
</script>
</body>
</html>